package com.commerceE.dao.impl;

import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.commerceE.common.dao.GenericIBatisDaoImpl;
import com.commerceE.dao.ProductTagDao;
import com.commerceE.domain.ProductTag;

public class ProductTagDaoImpl extends GenericIBatisDaoImpl<ProductTag>
		implements ProductTagDao {
	@Override
	public String getNAMESPACE() {
		return ProductTag.class.getName();
	}

	public List<ProductTag> getProductTagListByTagType(String tagType) {
		try {
			if (StringUtils.isBlank(tagType)) {
				return getSqlSession().selectList(getNAMESPACE() + ".selectAll", tagType);
			} else {
				return getSqlSession().selectList(getNAMESPACE() + ".selectProductTagListByTagType",tagType);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}
